<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<title>Mont Blanc Foot F7 - Dar de Alta Jugadores</title>

		<?php $this -> load -> view('head_view');?>
	</head>
	<body id="page1">
		<div id="main-bg-top">
			<div id="main-bg-bot">
				<div id="main">
					<!-- header -->
					<div id="header">
						<?php $this -> load -> view('league_header');?>
					</div>
					<!-- content -->
					<div id="content">
						<!-- script -->
						<div id="indent">
							<!-- scroller news -->
							<h2>Marcador Final - <?php echo $match_date; ?></h2>
							<table class='score-header'>
								<t>
									<th>
									<?php echo $team_home_name;?>
									</th>
									<th>vs</th>
									<th>
									<?php echo $team_visit_name;?>
									</th>
									</tr>
									<tr>
										<td>
										<?php
										if(empty($home_score)) { echo 0;
										} else { echo $home_score;
										}
										?>
										</td>
										<td>-</td>
										<td>
										<?php
										if(empty($visit_score)) { echo 0;
										} else { echo $visit_score;
										}
										?>
										</td>
									</tr>
							</table>

							<table class='score-annotation'>
								<tr>
									<th colspan="2">
									<h1>Anotaciones</h1>
									</th>
								</tr>

								<?php
								
								$count = 0;
								$home_count = sizeof($annotations_home);
								$visit_count = sizeof($annotations_visit);
								//if ()
								//echo $home_count ."<br />";
								//echo $visit_count ."<br />";
								
								if ($home_count > $visit_count){
								$count = $home_count;
								} elseif ($visit_count > $home_count){
								$count = $visit_count;
								} elseif ($visit_count == $home_count){
								$count = $visit_count;
								}
								
								for($i = 0; $i <= $count -1; $i++) {

								?>
								<tr>
									<!-- TODO ADD link to playerinfo using id -->
									
									<td class='home'>
									<?php if(isset($annotations_home[$i]->player_name)){
									?>
									<span id="<?php echo $annotations_home[$i]->score_id ?>" class="delete-annotation-left ui-icon ui-icon-triangle-1-e"></span>
									<a href="/index.php/players/playerinfo/<?php echo $annotations_home[$i] -> player_id; ?>">
									<?php echo $annotations_home[$i] -> player_name . "</a> (" . $annotations_home[$i] -> time . "')";
										}
									?>
									</td>
									<td class='visit'>
									<?php if(isset($annotations_visit[$i]->player_name)){
									?>
									<span id="<?php echo $annotations_visit[$i]->score_id ?>" class="delete-annotation-right ui-icon ui-icon-triangle-1-w"></span>
									<a href="/index.php/players/playerinfo/<?php echo $annotations_visit[$i] -> player_id; ?>">
									<?php echo $annotations_visit[$i] -> player_name . "</a> (" . $annotations_visit[$i] -> time . "')";
										}
									?>
									</td>
								</tr>
								<?php
								}
								?>
							</table>
							<br />
							<div class="wrapper">
								<div id="column-left">
									<!-- Latest players added to league -->
									<!-- Team Administration -->
								</div>
							</div>
						</div>
					</div>
					<!-- footer -->
					<div id="footer">
						<?php $this -> load -> view('league_footer');?>
					</div>
				</div>
			</div>
		</div>
	</body>
</html>
